package cn.nubia.admin.common.ftp;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by Administrator on 2014/4/3.
 */
public class FtpFileItem implements Serializable {

    /** A constant indicating an FTPFile is a file. ***/
    public static final int FILE_TYPE = 0;
    /** A constant indicating an FTPFile is a directory. ***/
    public static final int DIRECTORY_TYPE = 1;
    /** A constant indicating an FTPFile is a symbolic link. ***/
    public static final int SYMBOLIC_LINK_TYPE = 2;
    /** A constant indicating an FTPFile is of unknown type. ***/
    public static final int UNKNOWN_TYPE = 3;


    public FtpFileItem(String name, Date time, Integer type) {
        this.name = name;
        this.time = time;
        this.type = type;
    }

    /**
     * 文件名
     */
    private String name;

    /**
     * 时间
     */
    private Date time;

    /**
     * 是否为目录
     */
    private Integer type;

    /**
     * 是否为专题主文件
     */
    private Boolean isIndexPage = false;

    private String path;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public boolean isDirectory()
    {
        return (type == DIRECTORY_TYPE);
    }

    public boolean isFile()
    {
        return (type == FILE_TYPE);
    }


    public boolean isSymbolicLink()
    {
        return (type == SYMBOLIC_LINK_TYPE);
    }


    public boolean isUnknown()
    {
        return (type == UNKNOWN_TYPE);
    }

    public Boolean getIsIndexPage() {
        return isIndexPage;
    }

    public void setIsIndexPage(Boolean isIndexPage) {
        this.isIndexPage = isIndexPage;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }
}
